home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bytesc88.arc / CC1.C < prev    next >
Text File  |  1987-10-04  |  4KB  |  117 lines

  1. /*
  2. ** Small-C Compiler Part 1
  3. */
  4. #include <stdio.h>
  5. #include "notice.h"
  6. #include "cc.def"
  7.  
  8. /*
  9. ** miscellaneous storage
  10. */
  11. char
  12. #ifdef OPTIMIZE
  13.   optimize,    /* optimize output of staging buffer */
  14. #endif
  15.   alarm,    /* audible alarm on errors? */
  16.   monitor,    /* monitor function headers? */
  17.   pause,    /* pause for operator on errors? */
  18. #ifdef DYNAMIC
  19.  *stage,    /* output staging buffer */
  20.  *symtab,    /* symbol table */
  21.  *litq,        /* literal pool */
  22.  *macn,        /* macro name buffer */
  23.  *macq,        /* macro string buffer */
  24.  *pline,    /* parsing buffer */
  25.  *mline,    /* macro buffer */
  26. #else
  27.   stage[STAGESIZE],
  28.   symtab[SYMTBSZ],
  29.   litq[LITABSZ],
  30.   macn[MACNSIZE],
  31.   macq[MACQSIZE],
  32.   pline[LINESIZE],
  33.   mline[LINESIZE],
  34.   swq[SWTABSZ],
  35. #endif
  36.  *line,        /* points to pline or mline */
  37.  *lptr,        /* ptr to either */
  38.  *glbptr,    /* ptrs to next entries */
  39.  *locptr,    /* ptr to next local symbol */
  40.  *stagenext,    /* next addr in stage */
  41.  *stagelast,    /* last addr in stage */
  42.   quote[2],    /* literal string for '"' */
  43.  *cptr,        /* work ptrs to any char buffer */
  44.  *cptr2,
  45.  *cptr3,
  46.   msname[NAMESIZE],    /* macro symbol name array */
  47.   ssname[NAMESIZE];    /* static symbol name array */
  48. int
  49. #ifdef STGOTO
  50.   nogo,        /* > 0 disables goto statements */
  51.   noloc,    /* > 0 disables block locals */
  52. #endif
  53.   op[16],    /* function addresses of binary operators */
  54.   op2[16],    /* same for unsigned operators */
  55.   opindex,    /* index to matched operator */
  56.   opsize,    /* size of operator in bytes */
  57.   swactive,    /* true inside a switch */
  58.   swdefault,    /* default label #, else 0 */
  59.  *swnext,    /* address of next entry */
  60.  *swend,    /* address of last table entry */
  61. #ifdef DYNAMIC
  62.  *wq,        /* while queue */
  63. #else
  64.   wq[WQTABSZ],
  65. #endif
  66.   argcs,    /* static argc */
  67.  *argvs,    /* static argv */
  68.  *wqptr,    /* ptr to next entry */
  69.   litptr,    /* ptr to next entry */
  70.   macptr,    /* macro buffer index */
  71.   pptr,        /* ptr to parsing buffer */
  72.   oper,        /* address of binary operator function */
  73.   cch,        /* current character of line being scanned */
  74.   nch,        /* next character of line being scanned */
  75.   declared,    /* # of local bytes declared, else -1 when done */
  76.   iflevel,    /* #if... nest level */
  77.   skiplevel,    /* level at which #if... skipping started */
  78.   func1,    /* true for first function */
  79.   nxtlab,    /* next avail label # */
  80.   litlab,    /* label # assigned to literal pool */
  81.   beglab,    /* beginning label -- first function */
  82.   csp,        /* compiler relative stk ptr */
  83.   argstk,    /* function arg sp */
  84.   argtop,
  85.   ncmp,        /* # open compound statements */
  86.   errflag,    /* non-zero after 1st error in statement */
  87.   eof,        /* set non-zero on final input eof */
  88.   input,    /* fd # for input file */
  89.   input2,    /* fd # for "include" file */
  90.   output,    /* fd # for output file */
  91.   files,    /* non-zero if file list specified on cmd line */
  92.   filearg,    /* cur file arg index */
  93.   glbflag,    /* non-zero if internal globals */
  94.   ctext,    /* non-zero to intermix c-source */
  95.   ccode,    /* non-zero while parsing c-code */
  96.         /* zero when passing assembly code */
  97.   listfp,    /* file pointer to list device */
  98.   lastst,    /* last executed statement type */
  99.  
  100.   swused,       /* 1=switch statement used, else 0 -- RG */
  101.  
  102.  *iptr;        /* work ptr to any int buffer */
  103.  
  104. #include "cc11.c"
  105. #include "cc12.c"
  106. #include "cc13.c"
  107.  
  108. #ifndef SEPARATE
  109. #include "cc21.c"
  110. #include "cc22.c"
  111. #include "cc31.c"
  112. #include "cc32.c"
  113. #include "cc33.c"
  114. #include "cc41.c"
  115. #include "cc42.c"
  116. #endif
  117.